package com.study.example.gameserver.module.player.entity;


import com.sparrow.cache.annotation.Cache;
import com.sparrow.cache.annotation.CacheType;
import com.sparrow.cache.entity.AbstractEntity;
import com.sparrow.common.map.Position;
import com.study.example.gameserver.base.dao.convert.PositionConverter;

import javax.persistence.*;

/**
 * 玩家持久化数据
 */
@Cache(cacheType = CacheType.STRONG)
@Entity
@Table(name = "PlayerEntity")
public class PlayerEntity extends AbstractEntity<Long> {
    @Id
    private Long playerId;

    private int server;

    private String account;

    private String name;

    private int level;

    private int exp;

    private long fightForce;

    private int sceneId;

    private int lineId;

    private int mapId;

    @Convert(converter = PositionConverter.class)
    @Column(name = "pos")
    private Position pos;

    private int angle;

    private int hp;

    private int maxHp;

    public Long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(Long playerId) {
        this.playerId = playerId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Long getPK() {
        return playerId;
    }

    @Override
    public long dispatchCode() {
        return playerId;
    }

    public void setServer(int server) {
        this.server = server;
    }

    public int getServer() {
        return server;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getExp() {
        return exp;
    }

    public void setExp(int exp) {
        this.exp = exp;
    }

    public void setFightForce(long fightForce) {
        this.fightForce = fightForce;
    }

    public long getFightForce() {
        return fightForce;
    }

    public int getSceneId() {
        return sceneId;
    }

    public void setSceneId(int sceneId) {
        this.sceneId = sceneId;
    }

    public int getMapId() {
        return mapId;
    }

    public void setMapId(int mapId) {
        this.mapId = mapId;
    }

    public Position getPos() {
        return pos;
    }

    public void setPos(Position pos) {
        this.pos = pos;
    }

    public void setLineId(int lineId) {
        this.lineId = lineId;
    }

    public int getLineId() {
        return lineId;
    }

    public int getAngle() {
        return angle;
    }

    public void setAngle(int angle) {
        this.angle = angle;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getHp() {
        return hp;
    }

    public int getMaxHp() {
        return maxHp;
    }

    public void setMaxHp(int maxHp) {
        this.maxHp = maxHp;
    }

    @Override
    public void serialize() {

    }

    @Override
    public void deSerialize() {

    }
}
